package com.jlf.core.context;

import com.jlf.core.context.entity.EU;
import com.jlf.core.context.entity.RP;

/**
 * 上下文工厂
 *
 * @author wujr
 * 2023/8/6
 * @version 1.0
 * 【变更历史】
 * [wujr 2023/8/6 1.0 新增]
 */
public class ContextFactory {
    private static final ThreadLocal<RP> _rp = new ThreadLocal<>();
    private static final ThreadLocal<EU> _eu = new ThreadLocal<>();

    public static RP rp(){
        return _rp.get();
    }
    public static EU eu(){
        return _eu.get();
    }
    public static void set(RP rp, EU eu){
        _rp.set(rp);
        _eu.set(eu);
    }

    public static void clear(){
        _rp.remove();
        _eu.remove();
    }
}
